using UnityEngine;
using UnityEngine.UI;

public class AssetsText : MonoBehaviour
{
    public Text assetsText; // UI文本组件的引用
    public HostDate host; // 主机对象的引用

    void Start()
    {
        assetsText = GameObject.Find("AssetsText").GetComponent<Text>();
        host = GameObject.Find("Host").GetComponent<HostDate>();
    }


    void Update()
    {
        UpdateAssetsText();
    }

    void UpdateAssetsText()
    {
        if (assetsText != null && host != null)
        {
            assetsText.text = "Assets: " + host.assets;
        }
    }
}
